package library.domain;

public class Book {
	private String bookApplicationMark;
	private String bookName;
	private String author;
	private String translator;
	private String publisher;
	private int publishYear;
	private String bookRental;
	private String memberId;
	private Member member;
	
	public Book(){}
	//번역자 제외, 회원아이디 제외
	public Book(String bookApplicationMark, String bookName, String author,
			String publisher, int publishYear, String bookRental) {
		super();
		this.bookApplicationMark = bookApplicationMark;
		this.bookName = bookName;
		this.author = author;
		this.publisher = publisher;
		this.publishYear = publishYear;
		this.bookRental = bookRental;
	}
	//번역자 제외, 회원아이디 포함
	public Book(String bookApplicationMark, String bookName, String author,
			String publisher, int publishYear, String bookRental,
			String memberId) {
		super();
		this.bookApplicationMark = bookApplicationMark;
		this.bookName = bookName;
		this.author = author;
		this.publisher = publisher;
		this.publishYear = publishYear;
		this.bookRental = bookRental;
		this.memberId = memberId;
	}
	//번역자 포함, 회원아이디 제외
	public Book(String bookApplicationMark, String bookName, String author,
			String translator, String publisher, int publishYear,
			String bookRental) {
		super();
		this.bookApplicationMark = bookApplicationMark;
		this.bookName = bookName;
		this.author = author;
		this.translator = translator;
		this.publisher = publisher;
		this.publishYear = publishYear;
		this.bookRental = bookRental;
	}
	//번역자 포함, 회원아이디 포함
	public Book(String bookApplicationMark, String bookName, String author,
			String translator, String publisher, int publishYear,
			String bookRental, String memberId) {
		super();
		this.bookApplicationMark = bookApplicationMark;
		this.bookName = bookName;
		this.author = author;
		this.translator = translator;
		this.publisher = publisher;
		this.publishYear = publishYear;
		this.bookRental = bookRental;
		this.memberId = memberId;
	}
	public String getBookApplicationMark() {
		return bookApplicationMark;
	}
	public void setBookApplicationMark(String bookApplicationMark) {
		this.bookApplicationMark = bookApplicationMark;
	}
	public String getBookName() {
		return bookName;
	}
	public void setBookName(String bookName) {
		this.bookName = bookName;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getTranslator() {
		return translator;
	}
	public void setTranslator(String translator) {
		this.translator = translator;
	}
	public String getPublisher() {
		return publisher;
	}
	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}
	public int getPublishYear() {
		return publishYear;
	}
	public void setPublishYear(int publishYear) {
		this.publishYear = publishYear;
	}
	public String getBookRental() {
		return bookRental;
	}
	public void setBookRental(String bookRental) {
		/*
		if(bookRental=="대출가능" || bookRental=="대출중" || bookRental=="대출불가"){
			this.bookRental = bookRental;	
		}
		*/
		this.bookRental = bookRental;	
	}
	public String getMemberId() {
		return memberId;
	}
	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}
	public Member getMember() {
		return member;
	}
	public void setMember(Member member) {
		this.member = member;
	}
	
	@Override
	public String toString() {
		return "Book [bookApplicationMark=" + bookApplicationMark
				+ ", bookName=" + bookName + ", author=" + author
				+ ", translator=" + translator + ", publisher=" + publisher
				+ ", publishYear=" + publishYear + ", bookRental=" + bookRental
				+ ", memberId=" + memberId + ", member=" + member + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((author == null) ? 0 : author.hashCode());
		result = prime
				* result
				+ ((bookApplicationMark == null) ? 0 : bookApplicationMark
						.hashCode());
		result = prime * result
				+ ((bookName == null) ? 0 : bookName.hashCode());
		result = prime * result
				+ ((bookRental == null) ? 0 : bookRental.hashCode());
		result = prime * result + ((member == null) ? 0 : member.hashCode());
		result = prime * result
				+ ((memberId == null) ? 0 : memberId.hashCode());
		result = prime * result + publishYear;
		result = prime * result
				+ ((publisher == null) ? 0 : publisher.hashCode());
		result = prime * result
				+ ((translator == null) ? 0 : translator.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Book other = (Book) obj;
		if (author == null) {
			if (other.author != null)
				return false;
		} else if (!author.equals(other.author))
			return false;
		if (bookApplicationMark == null) {
			if (other.bookApplicationMark != null)
				return false;
		} else if (!bookApplicationMark.equals(other.bookApplicationMark))
			return false;
		if (bookName == null) {
			if (other.bookName != null)
				return false;
		} else if (!bookName.equals(other.bookName))
			return false;
		if (bookRental == null) {
			if (other.bookRental != null)
				return false;
		} else if (!bookRental.equals(other.bookRental))
			return false;
		if (member == null) {
			if (other.member != null)
				return false;
		} else if (!member.equals(other.member))
			return false;
		if (memberId == null) {
			if (other.memberId != null)
				return false;
		} else if (!memberId.equals(other.memberId))
			return false;
		if (publishYear != other.publishYear)
			return false;
		if (publisher == null) {
			if (other.publisher != null)
				return false;
		} else if (!publisher.equals(other.publisher))
			return false;
		if (translator == null) {
			if (other.translator != null)
				return false;
		} else if (!translator.equals(other.translator))
			return false;
		return true;
	}
	
	
	
	
	
	
	
	
}
